home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-19 / quikcmd3.zip / FASTCALC.LSP < prev    next >
Lisp/Scheme  |  1992-07-05  |  5KB  |  129 lines

  1. ;  FASTCALC.LSP
  2.  ;
  3.  ;                         QUICK COMMAND Release 3.0
  4.  ;                   FASTCALC.LSP is a module of QUICK COMMAND
  5. ;                       Copyright 1989, 90, 92 Dan Jincks
  6.  ;
  7.  ;
  8. ;              This is SHAREWARE, it is NOT Public Domain software.
  9.  ;
  10.  ;              This code or any part of this code may not be reproduced
  11.  ;              in any publication without prior written permission.
  12.  ;
  13.  ;              Printed copy of this code or any part of this code may not
  14.  ;              be distributed without prior written permission.
  15.  ;
  16.  ;              Printed copy may only be made for reference purposes by
  17.  ;              the end user.
  18.  ;
  19.  ;
  20.  ;                               Dan Jincks
  21.  ;                             Box 155A HCR 77
  22.  ;                           Annapolis, MO 63620
  23.  ;
  24.  ;
  25.  ;
  26.  ;   You are granted a limited license to use FASTCALC.LSP for a 30 day trial
  27.  ;   period.  If you wish to continue using any or all of QUICK COMMAND after
  28.  ;   the trial period, you must become a registered user.  As a registered
  29.  ;   user, you may use QUICK COMMAND on 1 workstation or terminal.
  30.  ;   Additional registrations must be bought for each additional workstation or
  31.  ;   terminal.  To become a registered user, see QC3.DOC
  32.  ;
  33.  ;
  34.  ;   You may send copies of QUICK COMMAND to friends and associates if you abide
  35.  ;   by the following rules:
  36.  ;
  37.  ;   1. It may only be distributed in the original unmodified form.
  38.  ;   2. All original files must be included.
  39.  ;   3. No addition files may be added.
  40.  ;   4. If other files will be on the same disk, QUICK COMMAND files must be in
  41.  ;      a library format such as ".ARC" called "QUICKCMD", or else be put alone
  42.  ;      in a subdirectory called "QUICKCMD".
  43.  ;   5. You may not sell QUICK COMMAND or any part of it.
  44.  ;   6. You are not allowed to charge more then $5 to cover the cost of copying
  45.  ;      and distribution.
  46.  ;   7. You may not distribute any hard copy of the contents of QUICK COMMAND.
  47.  ;
  48.  ;
  49.  ;   These AutoLISP commands and functions are designed to save you time, and
  50.  ;   saving time means saving money.  The registration fee is very modest
  51.  ;   compared to the savings, and much less expensive then typical third party
  52.  ;   AutoCAD software. Be sure to registar if you continue to use them.
  53.  ;
  54.  ;
  55.  ;                                                               DAN
  56.  ;
  57.  ;
  58.  ;
  59.  ;
  60.  ;        AutoCAD and AutoLISP are registered trade marks of Autodesk Inc.
  61.  ;
  62.  ;        ***************************************************************
  63.  ;
  64.  ;   Begin FASTCALC.LSP
  65.  ;
  66. ;  CA and (CA) functions
  67.  ;
  68. (defun C:CA ()(CA))
  69. (defun CA (/ SCA SCB SCC SCF)
  70.    (prompt "                   Calculator !!!   ")(terpri)
  71.    (prompt " ")(terpri)
  72.    (if (/= ANS nil)(progn
  73.       (prompt "Start with previous answer:  ")(prin1 ANS)(prompt " ?       ")
  74.       (initget "Yes No")
  75.       (setq SCB (getkword " Yes/No <No>  "))))(terpri)
  76.    (if (or (= SCB "No")(= SCB nil))(progn
  77.       (initget (+ 1 2))
  78.       (setq ANS (getdist "Enter first number or distance:   "))))
  79.    (setq SCF 0)
  80.    (while (/= SCF nil)(progn
  81.       (prompt " ")(terpri)
  82.       (prin1 ANS)
  83.       (initget "Add Subtract Multiply Divide SQuareroot + * - /")
  84.       (setq SCF
  85.          (getkword "           Add/Subtract/Multiply/Divide/SQuareroot   "))
  86.       (terpri)
  87.       (if (or (= SCF "Add")(= SCF "+"))(progn
  88.          (setq SCA ANS)(prin1 SCA)
  89.          (initget  (+ 1 2))
  90.          (setq SCC (getdist " + ? "))(terpri)
  91.          (setq ANS (+ ANS SCC))(prin1 SCA)(prompt" + ")(prin1 SCC)(prompt" = ")
  92.          (prin1 ANS)(terpri)
  93.          )
  94.       )
  95.       (if (or (= SCF "Subtract")(= SCF "-"))(progn
  96.          (setq SCA ANS)(prin1 SCA)
  97.          (initget (+ 1 2))
  98.          (setq SCC (getdist " - ? "))(terpri)
  99.          (setq ANS (- ANS SCC))(prin1 SCA)(prompt" - ")(prin1 SCC)(prompt" = ")
  100.          (prin1 ANS)(terpri)
  101.          )
  102.       )
  103.       (if (or (= SCF "Multiply")(= SCF "*"))(progn
  104.          (setq SCA  ANS)(prin1 SCA)
  105.          (initget (+ 1 2))
  106.          (setq SCC (getdist " * ? "))(terpri)
  107.          (setq ANS (* ANS SCC))(prin1 SCA)(prompt" * ")(prin1 SCC)(prompt" = ")
  108.          (prin1 ANS)(terpri)
  109.          )
  110.       )
  111.       (if (or (= SCF "Divide")(= SCF "/"))(progn
  112.          (setq SCA  ANS)(prin1 SCA)
  113.          (initget (+ 1 2))
  114.          (setq SCC (getdist " / ? "))(terpri)
  115.          (setq ANS (/ ANS SCC))(prin1 SCA)(prompt" / ")(prin1 SCC)(prompt" = ")
  116.          (prin1 ANS)(terpri)
  117.          )
  118.       )
  119.       (if (and (> ANS 0) (= SCF "SQuareroot"))(progn
  120.          (setq SCA ANS)
  121.          (setq ANS (sqrt ANS ))(prompt"Squareroot of ")(prin1 SCA)(prompt" = ")
  122.          (prin1 ANS)(terpri)
  123.          )
  124.       )
  125.    ))(princ)
  126. )
  127.  ;
  128.  ;   End FASTCALC.LSP
  129.